﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Frame.Lib.Core.Tree;


namespace Jzy.Model.DocManger
{  
    public partial class DirInfo:TreeInfo
    {
        public override string GetTableName()
        {
            return "Docdir";
        }
        public override string GetInsertSql()
        {
            return "insert into DocDir ( [ID], [Name], [UpperID], [Path], [Depth], [Orders], [Code], [TypeID], [CreatorID], [CreatorName], [InputTime], [Remark], [IsPrivate]) values ( @ID, @Name, @UpperID, @Path, @Depth, @Orders, @Code, @TypeID, @CreatorID, @CreatorName, @InputTime, @Remark, @IsPrivate)";
        }
        public override string GetUpdateSql()
        {
            return "update DocDir set  [ID] = @ID, [Name] = @Name, [UpperID] = @UpperID, [Path] = @Path, [Depth] = @Depth, [Orders] = @Orders, [Code] = @Code, [TypeID] = @TypeID, [CreatorID] = @CreatorID, [CreatorName] = @CreatorName, [InputTime] = @InputTime, [Remark] = @Remark, [IsPrivate] = @IsPrivate where ID = @ID";        
        }
        /// <summary>
        /// 
        /// </summary>
        public Int32 Code
        {
            get;
            set;
        }
        /// <summary>
        /// 目录类型
        /// </summary>
        public Int32 TypeID
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public Int32 CreatorID
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public String CreatorName
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public DateTime InputTime
        {
            get;
            set;
        }
        /// <summary>
        /// 备注
        /// </summary>
        public String Remark
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public Boolean IsPrivate
        {
            get;
            set;
        }

        public override void SetValue(string key, object value)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    this.ID = (Int32)value;
                    break;
                case "name":
                    this.Name = (String)value;
                    break;
                case "upperid":
                    this.UpperID = (Int32)value;
                    break;
                case "path":
                    this.Path = (String)value;
                    break;
                case "depth":
                    this.Depth = (Int32)value;
                    break;
                case "orders":
                    this.Orders = (Int32)value;
                    break;
                case "code":
                    this.Code = (Int32)value;
                    break;
                case "typeid":
                    this.TypeID = (Int32)value;
                    break;
                case "creatorid":
                    this.CreatorID = (Int32)value;
                    break;
                case "creatorname":
                    this.CreatorName = (String)value;
                    break;
                case "inputtime":
                    this.InputTime = (DateTime)value;
                    break;
                case "remark":
                    this.Remark = (String)value;
                    break;
                case "isprivate":
                    this.IsPrivate = (Boolean)value;
                    break;
            }
        }
        public override object GetValue(string key)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    return this.ID;
                case "name":
                    return this.Name;
                case "upperid":
                    return this.UpperID;
                case "path":
                    return this.Path;
                case "depth":
                    return this.Depth;
                case "orders":
                    return this.Orders;
                case "code":
                    return this.Code;
                case "typeid":
                    return this.TypeID;
                case "creatorid":
                    return this.CreatorID;
                case "creatorname":
                    return this.CreatorName;
                case "inputtime":
                    return this.InputTime;
                case "remark":
                    return this.Remark;
                case "isprivate":
                    return this.IsPrivate;
                default:
                    return null;
            }
        }

    }

}
